const Router = require('koa-router')
const home = require('../api/homeAPI')
const path = require('path')
const koaBody = require('koa-body')({
  multipart: true,
  formidable: {
    uploadDir: path.resolve(__dirname, '../public/uploads'),
    keepExtensions: true
  }
})

var router = new Router()
router.get('', home.get)
router.get('home', home.get)
router.get('user', home.get)
router.post('fileupload', koaBody, home.fileUpload)
router.get('download/:name', home.download)


module.exports = router